﻿<%@ Page Title="" Language="C#" MasterPageFile="~/NestedMasterPage.master" AutoEventWireup="true" CodeBehind="WebMyOrders.aspx.cs" Inherits="Web.WebMyOrders" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <p style="padding: 10px 0px 10px 0px;">
        <asp:SiteMapPath ID="SiteMapPath1" runat="server" CssClass="sitmap"
            Style="font-family: 幼圆; font-size: medium" Font-Names="Verdana" Font-Size="0.8em" PathSeparator=" > ">
            <PathSeparatorStyle Font-Bold="True" ForeColor="#990000" />
            <CurrentNodeStyle ForeColor="#333333" />
            <NodeStyle Font-Bold="True" />
            <RootNodeStyle Font-Bold="True" />
        </asp:SiteMapPath>
    </p>
    <link href="css/bootstrap.min.css" rel="stylesheet" />
    <script src="js/plugins/layer/layer.min.js"></script>
    <div class="table-responsive">
        <table class="table">
            <caption>我的订单</caption>
            <thead>
                <tr>

                    <th>订单编号</th>
                    <th>产品</th>
                    <th>数量</th>
                    <th>价格</th>
                    <th>状态</th>
                </tr>
            </thead>
            <%if (list.Count > 0)
              {  %>
            <tbody>
                <%foreach (var item in list) %>
                <%{ %>
                <tr>

                    <td><%=item.order_number %></td>
                    <td><%=item.goods_name %></td>
                    <td><%=item.buy_nums %></td>
                    <td><%=item.buy_prices %></td>
                    <td><%=item.states_name %>
                          <%if (item.status == 2)
                          {  %>
                        <button type="button" style="text-align: center" v="<%=item.Id %>" class="btn-link" name="exShop" onclick="ExShop(this)">退货</button>
                        <% } %>
                        <%else if (item.status == 3)
                          {  %>
                        <button type="button" style="text-align: center" v="<%=item.Id %>" class="btn-link" name="del" onclick="PL(this)">评价</button>
                        <% } %>

                    </td>
                </tr>
                <% } %>
            </tbody>
            <tfoot>
            </tfoot>
            <% }
              else
              { %>
            <tbody>
                <tr>
                    <td colspan="5" style="text-align: center">暂时没有数据...</td>
                </tr>
            </tbody>
            <% } %>
        </table>
    </div>
    <script>
        function PL(ck) {
            var this_Id = $(ck).attr('v');
          
            var index = parent.layer.open({
                type: 2,
                title: '编辑',
                shadeClose: true,
                shade: 0.8,
                area: ['80%', '60%'],
                content: '../WebUserCallMsg.aspx?Id=' + this_Id,
                end: function () {

                    layer.close(index);
                    location.reload();

                }
            });
        }
        function ExShop(ck) {
            var this_Id = $(ck).attr('v');
            $.ajax({
                type: 'post',
                url: '../Hanlder/OrderHandler.ashx?Method=ExShop',
                data: { Id: this_Id},
                success: function (data) {
                    alert('操作成功');
                    location.reload();
                }
            });
          
        }
    </script>
</asp:Content>
